package com.tech.thread;

/**
 * @Description:
 * 1、多线程异步执行
 * 2、主线程进行汇总
 * @Author: zl
 * @Date: 2019/7/12 15:14
 */
public class JoinCountDownLatchTest {

    public static void main(String[] args) throws InterruptedException {
        Thread t01 = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("this is t01");
            }
        });

        Thread t02 = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("this is t02");
            }
        });
        t01.start();
        t02.start();
        t01.join();
        t02.join();
        System.out.println("t01、t02 runnable end");
    }
}
